import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/shift/turn_orver_bean.dart';
import 'package:flutter_deer/database/beans/shift/current_shift_entity.dart';


ConfirmHandOverBean $ConfirmHandOverBeanFromJson(Map<String, dynamic> json) {
  final ConfirmHandOverBean confirmHandOverBean = ConfirmHandOverBean();
  final String? actualAmount = jsonConvert.convert<String>(json['actualAmount']);
  if (actualAmount != null) {
    confirmHandOverBean.actualAmount = actualAmount;
  }
  final String? discountAmount = jsonConvert.convert<String>(json['discountAmount']);
  if (discountAmount != null) {
    confirmHandOverBean.discountAmount = discountAmount;
  }
  final String? endTime = jsonConvert.convert<String>(json['endTime']);
  if (endTime != null) {
    confirmHandOverBean.endTime = endTime;
  }
  final String? merchantWorkCycleId = jsonConvert.convert<String>(json['merchantWorkCycleId']);
  if (merchantWorkCycleId != null) {
    confirmHandOverBean.merchantWorkCycleId = merchantWorkCycleId;
  }
  final String? nowDateTime = jsonConvert.convert<String>(json['nowDateTime']);
  if (nowDateTime != null) {
    confirmHandOverBean.nowDateTime = nowDateTime;
  }
  final String? headUserName = jsonConvert.convert<String>(json['headUserName']);
  if (headUserName != null) {
    confirmHandOverBean.headUserName = headUserName;
  }
  final String? orderCount = jsonConvert.convert<String>(json['orderCount']);
  if (orderCount != null) {
    confirmHandOverBean.orderCount = orderCount;
  }
  final String? newWorkCycleCode = jsonConvert.convert<String>(json['newWorkCycleCode']);
  if (newWorkCycleCode != null) {
    confirmHandOverBean.newWorkCycleCode = newWorkCycleCode;
  }
  final String? receivableAmount = jsonConvert.convert<String>(json['receivableAmount']);
  if (receivableAmount != null) {
    confirmHandOverBean.receivableAmount = receivableAmount;
  }
  final String? startTime = jsonConvert.convert<String>(json['startTime']);
  if (startTime != null) {
    confirmHandOverBean.startTime = startTime;
  }
  final String? workCycleCode = jsonConvert.convert<String>(json['workCycleCode']);
  if (workCycleCode != null) {
    confirmHandOverBean.workCycleCode = workCycleCode;
  }
  final int? workCycleStatus = jsonConvert.convert<int>(json['workCycleStatus']);
  if (workCycleStatus != null) {
    confirmHandOverBean.workCycleStatus = workCycleStatus;
  }
  final String? energyOrderGoodsQuantity = jsonConvert.convert<String>(json['energyOrderGoodsQuantity']);
  if (energyOrderGoodsQuantity != null) {
    confirmHandOverBean.energyOrderGoodsQuantity = energyOrderGoodsQuantity;
  }
  final String? onlinePaymentAmount = jsonConvert.convert<String>(json['onlinePaymentAmount']);
  if (onlinePaymentAmount != null) {
    confirmHandOverBean.onlinePaymentAmount = onlinePaymentAmount;
  }
  final List<String>? energyOrderIds = (json['energyOrderIds'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (energyOrderIds != null) {
    confirmHandOverBean.energyOrderIds = energyOrderIds;
  }
  final List<String>? energyOrderPayingIds = (json['energyOrderPayingIds'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (energyOrderPayingIds != null) {
    confirmHandOverBean.energyOrderPayingIds = energyOrderPayingIds;
  }
  return confirmHandOverBean;
}

Map<String, dynamic> $ConfirmHandOverBeanToJson(ConfirmHandOverBean entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['actualAmount'] = entity.actualAmount;
  data['discountAmount'] = entity.discountAmount;
  data['endTime'] = entity.endTime;
  data['merchantWorkCycleId'] = entity.merchantWorkCycleId;
  data['nowDateTime'] = entity.nowDateTime;
  data['headUserName'] = entity.headUserName;
  data['orderCount'] = entity.orderCount;
  data['newWorkCycleCode'] = entity.newWorkCycleCode;
  data['receivableAmount'] = entity.receivableAmount;
  data['startTime'] = entity.startTime;
  data['workCycleCode'] = entity.workCycleCode;
  data['workCycleStatus'] = entity.workCycleStatus;
  data['energyOrderGoodsQuantity'] = entity.energyOrderGoodsQuantity;
  data['onlinePaymentAmount'] = entity.onlinePaymentAmount;
  data['energyOrderIds'] = entity.energyOrderIds;
  data['energyOrderPayingIds'] = entity.energyOrderPayingIds;
  return data;
}

extension ConfirmHandOverBeanExtension on ConfirmHandOverBean {
  ConfirmHandOverBean copyWith({
    String? actualAmount,
    String? discountAmount,
    String? endTime,
    String? merchantWorkCycleId,
    String? nowDateTime,
    String? headUserName,
    String? orderCount,
    String? newWorkCycleCode,
    String? receivableAmount,
    String? startTime,
    String? workCycleCode,
    int? workCycleStatus,
    String? energyOrderGoodsQuantity,
    String? onlinePaymentAmount,
    List<String>? energyOrderIds,
    List<String>? energyOrderPayingIds,
  }) {
    return ConfirmHandOverBean()
      ..actualAmount = actualAmount ?? this.actualAmount
      ..discountAmount = discountAmount ?? this.discountAmount
      ..endTime = endTime ?? this.endTime
      ..merchantWorkCycleId = merchantWorkCycleId ?? this.merchantWorkCycleId
      ..nowDateTime = nowDateTime ?? this.nowDateTime
      ..headUserName = headUserName ?? this.headUserName
      ..orderCount = orderCount ?? this.orderCount
      ..newWorkCycleCode = newWorkCycleCode ?? this.newWorkCycleCode
      ..receivableAmount = receivableAmount ?? this.receivableAmount
      ..startTime = startTime ?? this.startTime
      ..workCycleCode = workCycleCode ?? this.workCycleCode
      ..workCycleStatus = workCycleStatus ?? this.workCycleStatus
      ..energyOrderGoodsQuantity = energyOrderGoodsQuantity ?? this.energyOrderGoodsQuantity
      ..onlinePaymentAmount = onlinePaymentAmount ?? this.onlinePaymentAmount
      ..energyOrderIds = energyOrderIds ?? this.energyOrderIds
      ..energyOrderPayingIds = energyOrderPayingIds ?? this.energyOrderPayingIds;
  }
}

HandOverBean $HandOverBeanFromJson(Map<String, dynamic> json) {
  final HandOverBean handOverBean = HandOverBean();
  final CurrentShiftEntity? newMwc = jsonConvert.convert<CurrentShiftEntity>(json['newMwc']);
  if (newMwc != null) {
    handOverBean.newMwc = newMwc;
  }
  final CurrentShiftEntity? oldMwc = jsonConvert.convert<CurrentShiftEntity>(json['oldMwc']);
  if (oldMwc != null) {
    handOverBean.oldMwc = oldMwc;
  }
  return handOverBean;
}

Map<String, dynamic> $HandOverBeanToJson(HandOverBean entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['newMwc'] = entity.newMwc?.toJson();
  data['oldMwc'] = entity.oldMwc?.toJson();
  return data;
}

extension HandOverBeanExtension on HandOverBean {
  HandOverBean copyWith({
    CurrentShiftEntity? newMwc,
    CurrentShiftEntity? oldMwc,
  }) {
    return HandOverBean()
      ..newMwc = newMwc ?? this.newMwc
      ..oldMwc = oldMwc ?? this.oldMwc;
  }
}